<template>
    <div class="find">
         <div class="wrapper">
        <!-- 头部 star  -->
        <div class="header">
            <router-link tag="a" to="/search?id=/find">
          <div class="inp" @click="change">输入你想听的故事</div>
        </router-link>
        </div>
        <!-- 头部 end   -->
        <!-- 分类 star  -->
        <div class="type">
            <ul>
                <li v-for="item in findType" :key="item.id">
                    <a @click="Jump(item.id)">
                        <img :src="item.img" alt="">
                    </a>
                </li>
                
            </ul>
        </div>
        <!-- 分类 end  -->

        <!-- 最新专题 star  -->
        <div class="new">
            <div class="title">
                最新专题
            </div>
            <div class="main">
                <ul>
                    <li v-for="item in newfind" :key="item.id">
                      <router-link tag="div" :to="'/findList?id='+item.id">
                        <div class="img">
                            <img :src="item.img" alt="">
                        </div>
                        <div class="work">
                            <p>{{item.titleone}}</p>
                            <p>{{item.titletwo}}</p>
                        </div>
                      </router-link>
                    </li>
                    
                  
                </ul>

            </div>
        </div>
        <!-- 最新专题 end  -->


      
    </div>
    </div>
</template>

<script>
import {getJsonData} from "../api/home.js"
    export default {
        data(){
          return {
            findType:[],
            newfind:[]
          }
        },
        methods:{
          change(){
            this.$emit('change');
          },
          Jump(id){
            if(id!=1006){
              this.$router.push("/homeType?routers=/find&id="+ id);
            }else if(id ==1006){
              this.$router.push("/classification?routersId=/find");
            }
          }
        },
        created(){
          getJsonData().then(data=>{
            this.findType=data.findType
            this.newfind=data.newfind
          })
        }
    }
</script>

<style lang="scss" scoped>
.find{
    background-color: #f4f4f4;
    .header {
  height: 30px;
  padding: 18px 72px 18px 23px;
  display: flex;
  a {
    display: block;
    flex: 1;
    width: 222px;
    height: 28px;
  }
  .inp {
    background: url(../assets/img/iv_sou.png) 14px 7px no-repeat;
    background-size: 14px;
    line-height: 28px;
    padding-left: 36px;
    font-size: 12px;
    color: #838383;
    background-color: #eae9e9;
    border-radius: 14px;
  }
}
.type {
  padding: 0 14px;
  ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    li {
      width: 45.8%;
      padding-bottom: 18px;
      img {
        width: 100%;
      }
    }
  }
}
.new {
  padding: 0 14px 100px;
  .title {
    font-weight: bold;
    padding-left: 22px;
    background: url(../assets/img/ic_faxian_biaozhi.png) 2px 2px no-repeat;
    background-size: 15px;
    margin-bottom: 16px;
  }
  .main {
    // padding-bottom: 85px;
    ul {
      li {
        margin-bottom: 16px;
      }
    }
    .img {
      img {
        width: 100%;
        height: 202px;
        border-radius: 10px;
      }
    }
  }
  .work {
    padding-left: 8px;
    p {
      &:nth-child(1) {
        color: #000;
        font-weight: bold;
        height: 36px;
        line-height: 36px;
        font-size: 16px;
      }
      &:nth-child(2) {
        font-size: 12px;
        height: 20px;
        line-height: 20px;
        color: #7a7a7a;
      }
    }
  }
}
/* .new .main .img{} */


}
</style>